<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <meta name="Keywords" content="FreeMarker, template, templates, HTML, HTML template, page template, text, macro, macros, preprocessor, MVC, view, servlet, Java, free, open source, JSP, taglib, Velocity, WebMacro">
    <meta name="Description" content="Java template engine; a generic tool to generate text output (HTML, RTF, source code, etc.). Practical for servlet-based Web applications following the MVC pattern. Free.">
    <meta name="verify-v1" content="OU7KNU7q+wGizVoaX/MNUo/tZ5o5RC06VfCjQIRRJu4=">
    <link rel="STYLESHEET" type="text/css" href="site.css">
    <title>FreeMarker: Java Template Engine Library - Features</title>
  </head>
  <body>
    <table border="0" cellspacing="0" cellpadding="0" width="100%">
      <tr>
        <td align="left" valign="top" width="20%">
  <table bgcolor="#E0E0E0" cellspacing="0" cellpadding="0" border="0" width="100%">
    <tr valign="top">
      <td height="1" width="1" bgcolor="black"><img src="images/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"></td>
      <td height="1" bgcolor="black"><img src="images/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"></td>
      <td height="1" width="1" bgcolor="black"><img src="images/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"></td>
    </tr>
    <tr>
      <td width="1" bgcolor="black"><img src="images/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td>
      <td>
        <table bgcolor="#E0E0E0" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: 0px">
          <tr><td>

  <table bgcolor="#E0E0E0" border="0" cellspacing="10" cellpadding="0" width="100%">
    <tr><td colspan="2" align="center">
        <a href="http://freemarker.org"><img border="0" src="images/logo_e0e0e0.png" alt="FreeMarker logo"></a><br>&nbsp;
    </td></tr>

  
    <tr><td>
  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr><td width="100%">
      <b>About</b>
    </td></tr>
  </table>
  <table border="0" cellpadding="0" cellspacing="0" width="100%">

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="index.html">Overview</a>
    </td>
  </tr>

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="features.html">Features</a>
    </td>
  </tr>

      </table>
</td></tr>

    <tr><td>
  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr><td width="100%">
      <b>Download</b>
    </td></tr>
  </table>
  <table border="0" cellpadding="0" cellspacing="0" width="100%">

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="freemarkerdownload.html">FreeMarker</a>
    </td>
  </tr>

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="editors.html">Editor/IDE plugins</a>
    </td>
  </tr>

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="fmpp.html">File generator tool (FMPP)</a>
    </td>
  </tr>

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="usCavalry.html">Migrating from Velocity</a>
    </td>
  </tr>

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="libraries.html">FTL Libraries</a>
    </td>
  </tr>

      </table>
</td></tr>

    <tr><td>
  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr><td width="100%">
      <b>Documentation</b>
    </td></tr>
  </table>
  <table border="0" cellpadding="0" cellspacing="0" width="100%">

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="docs/index.html">Table of Contents</a>
    </td>
  </tr>

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="docs/api/index.html">Short-cut to: Java API</a>
    </td>
  </tr>

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="docs/app_faq.html">Short-cut to: FAQ</a>
    </td>
  </tr>

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="docs/alphaidx.html">Short-cut to: Index</a>
    </td>
  </tr>

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="docs/app_versions.html">Short-cut to: Versions</a>
    </td>
  </tr>

      </table>
</td></tr>

    <tr><td>
  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr><td width="100%">
      <b>Community, help</b>
    </td></tr>
  </table>
  <table border="0" cellpadding="0" cellspacing="0" width="100%">

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="http://sourceforge.net/tracker/?func=add&amp;group_id=794&amp;atid=100794">REPORT BUGS HERE!</a>
    </td>
  </tr>

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="http://sourceforge.net/mail/?group_id=794">Mailing list subscription</a>
    </td>
  </tr>

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="gmane.html">Browse/search the mailing list archives</a>
    </td>
  </tr>

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="gmane.html">News (nntp) interface</a>
    </td>
  </tr>

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="https://sourceforge.net/forum/?group_id=794">Web forums</a>
    </td>
  </tr>

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="http://freemarker.org/builds/">Development builds (automatic)</a>
    </td>
  </tr>

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="http://freemarker.org/wiki">Wiki</a>
    </td>
  </tr>

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="http://freemarker.blogspot.com/">Blog</a>
    </td>
  </tr>

      </table>
</td></tr>

    <tr><td>
  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr><td width="100%">
      <b>Miscellaneous</b>
    </td></tr>
  </table>
  <table border="0" cellpadding="0" cellspacing="0" width="100%">

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="poweredBy.html">Powered by FreeMarker</a>
    </td>
  </tr>

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="http://sourceforge.net/projects/freemarker">SourceForge project page</a>
    </td>
  </tr>

        <tr>
    <td align="left" valign="top"><img src="images/bullet_e0e0e0.png" width=7 height=10 alt="-">&nbsp;</td>
    <td width="93%" align="left">
      <a class="nav" href="whoWeAre.html">Who we are</a>
    </td>
  </tr>

      </table>
</td></tr>

  
  </table>

          </td></tr>
        </table>
      </td>
      <td width="1" bgcolor="black"><img src="images/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td>
    </tr>
    <tr valign="top">
      <td height="1" width="1" bgcolor="black"><img src="images/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"></td>
      <td height="1" bgcolor="black"><img src="images/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"></td>
      <td height="1" width="1" bgcolor="black"><img src="images/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"></td>
    </tr>
  </table>            
        </td>
        <td align="left" valign="top" width="5%">
          &nbsp;
        </td>
        <td align="left" valign="top" width="72%">
          <table border="0" cellspacing="0" cellpadding="0" width="100%">
            <tr><td align="right"><span class="pageTitle">Features</span></td></tr>
            <tr bgcolor="#000000"><td><img src="images/none.gif" width=1 height=1 hspace="0" vspace="0" border="0" alt=""></td></tr>
          </table>

  
    <p>
      This page attempts to give you few highlights of FreeMarker features.
    </p>
  
  
    <h2>General purpose</h2>

      <ul>
        <li>Can be used to generate any kind of text: HTML, XML, RTF, Java source code, etc.</li>
        <li>Easy to embed into your product: Lightweight. Does not require servlet environment (does not depend on javax.servlet classes).</li>
        <li>Pluggable template loader: you can load templates from any sources; local files, database, etc.</li>
        <li>You can do whatever you want with the generated text: store it in a local file, send it as e-mail, send it back to a Web browser from a Web application, etc.</li>
      </ul>
    
    
    <h2>Powerful template language</h2>

      <ul>
        <li>All usual directives: include, if/elseif/else, loop constructs.</li>
        <li>Creating and changing variables in templates.</li>
        <li>Can use complex expressions to specify values almost everywhere.
          <ul>
            <li>String operations: concatenation, sub-string, uppercase, capitalize, escaping, etc.</li>
            <li>Decimal precision arithmetic calculations</li>
            <li>Boolean arithmetic</li>
            <li>Reading array and associative array elements</li>
            <li>Array and associative array literals</li>
            <li>You can add your own functions (methods) for special calculations.</li>
          </ul>
        </li>
        <li>Macros with named and positional parameters and with nested content (body). For example:<br />
            <tt>&lt;@myMacro color="red" width=2>...&lt;/@myMacro></tt></li>
        <li>Name-spaces to help build and maintain reusable macro libraries or to divide big projects into separated modules, without worrying about name clashes.</li>
        <li>Output transformation blocks. Do transformations as HTML-escaping, compression, syntax-highlight etc. on the output generated by the nested template fragment. You can define your own transformations.</li>
      </ul>
    
    
    <h2>Versatile data model</h2>

      <p>FreeMarker does not work through direct reflection on Java objects; the Java objects are exposed to the template as variables through pluggable object wrappers. Thus, you can show the objects (Java beans, XML documents, SQL query result sets, etc.) in an abstract, tailored way for the template authors, without bothering them with technical details.</p>
    
    
    <h2>Web-ready</h2>

      <ul>
        <li>Built-in constructs in the template language to handle typical Web related tasks like HTML-escaping.</li>
        <li>Can be integrated with "Model 2" Web application frameworks out-of-the-box as JSP replacement.</li>
        <li><b>Supports JSP taglibs</b>, up to JSP 2.1 currently, except that the JSP 2 "tag files" (i.e., when custom tags are <em>implemented</em> in JSP language rather than as Java classes) are not supported.</li>
        <li>Designed for MVC pattern: separate visual design from application logic, separate page designers from programmers.</li>
      </ul>
    
    
    <h2>Internationalization/localization aware</h2>

      <ul>
        <li>Charset aware (uses UNICODE internally).</li>
        <li>Locale sensitive number formatting.</li>
        <li>Locale sensitive date and time formatting.</li>
        <li>Non-US characters can be used in identifiers (as variable names).</li>
        <li>Multiple variations of the same template for different languages.</li>
      </ul>
    
    
    <h2>Powerful XML Processing Capabilities</h2>

      <ul>
        <li>&lt;#recurse> and &lt;#visit> directives (new in version 2.3) for recursively walking an XML tree</li>
        <li>Clean, intuitive XML object model accessible from template.</li>
      </ul>
    
    
    <h2>Comparing with other products</h2>

      <p>
        You might also be interested 
        <a href="fmVsVel.html">what distinguish
        FreeMarker from Apache Velocity</a>.
      </p>
      
      <p>
        FreeMarker 2.3 often can be used as an alternative to XSLT. You can read our comparison <a href="fmVsXSLT.html">here</a>. 
      </p>
    
  
        </td>
        <td align="left" valign="top" width="3%" rowspan=3>
          &nbsp;
        </td>
      </tr>
    </table>

    <p>&nbsp;
    
    <table border=0 cellspacing=0 cellpadding=0 width="100%">
      <tr><td height=1 bgcolor="#C0C0C0"><img src="images/none.gif" width=1 height=1 alt=""></td></tr>
    </table>
    <table border=0 cellspacing=0 cellpadding=0 width="100%">
      <tr>
      <td align=left valign=top class="footnote"><font size="1">&nbsp;<br></font>
        <b>Found broken link or other problem with this site?</b><br>
        Report to: <a href="mailto:ddekanyREMOVEME@freemail.hu">ddekanyREMOVEME@freemail.hu</a><br>
        (remove the "REMOVEME" from the address)<br>
      </td>
      <td align=right valign=top class="footnote"><font size="1">&nbsp;<br></font>
        Page last generated: 2009-12-08 08:39:00 GMT<br>
        All content on this page is copyrighted by the FreeMarker project.<br>
        &nbsp;
      </td>
    </table>

    <table border=0 cellspacing=0 cellpadding=0 width="100%">
      <tr>
        <td width="100%">&nbsp;</td>
        <td valign="middle" align="right">
            <a href="http://sourceforge.net"><img src="images/sflogo.png" border="0" alt="SourceForge Logo"></a>
        </td>
        <td>
          &nbsp;&nbsp;
        </td>
        <td valign="middle" align="right">
          <a href="http://freemarker.org"><img src="images/poweredby_ffffff.png" alt="Powered by FreeMarker" border="0"></a>
        </td>
    </table>
  </body>
</html>



